home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 001_015 / 003c / Text
Encoding:
Text File  |  1993-08-02  |  14.6 KB  |  368 lines

  1. -----------------------------------------------------------------------------
  2. 16th January 1993
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 003
  6. Issue: 1
  7. Author:
  8. -----------------------------------------------------------------------------
  9.  
  10. 1MHz Bus Application Note
  11.  
  12. -----------------------------------------------------------------------------
  13. Applicable Hardware: BBC B
  14.                      BBC B+
  15.                      BBC Master 128
  16.  
  17. Related Application Notes:
  18.  
  19.  
  20. -----------------------------------------------------------------------------
  21. Copyright (C) Acorn Computers Limited 1992
  22.  
  23. Every effort has been made to ensure that the information in this leaflet is 
  24. true and correct at the time of printing. However, the products described in
  25. this leaflet are subject to continuous development and improvements and
  26. Acorn Computers Limited reserves the right to change its specifications at
  27. any time. Acorn Computers Limited cannot accept liability for any loss or
  28. damage arising from the use of any information or particulars in this
  29. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  30. Limited.
  31. -----------------------------------------------------------------------------
  32. Support Group
  33. Acorn Computers Limited
  34. Acorn House
  35. Vision Park
  36. Histon
  37. Cambridge       CB4 4AE
  38. -----------------------------------------------------------------------------
  39. CONTENTS
  40.  
  41.  
  42.         SECTION         TITLE
  43.  
  44.         1               Introduction
  45.         
  46.         2               Signal Definitions
  47.         
  48.         3               Hardware Requirements for 1MHz Bus Expansion
  49.  
  50.         4               Requirements for Acorn Approval
  51.  
  52.         5               Derivation of Valid Page Select Signals
  53.  
  54.         6               Address Space Allocation
  55.  
  56.  
  57.                 DRAWINGS
  58.  
  59.         1 MHz Bus Timing Diagram                Figure 1
  60.  
  61.         Derivation of Valid Page Select Siganl  Figure 2
  62.  
  63.         Derivation of Clean Select Signals      Figure 3
  64.  
  65.         Board Dimensions to fit BBC
  66.         Microcomputer Expansion Box             Figure 4
  67.  
  68.         Circuit Diagram for BBC Machine
  69.         Expansion Box Backplane         Drg No 107,000
  70.  
  71. -----------------------------------------------------------------------------
  72.  
  73.  
  74. 1  INTRODUCTION
  75.  
  76. The BBC Microcomputer has been designed to allow expansion in a number of
  77. ways.  In addition to the specialised Disc and Printer plugs, there are
  78. three "general" expansion facilities.  For these facilities, the Model B has
  79. IDC headers mounted at the front edge of the main board, accessed from the
  80. underside of the case.
  81.  
  82. The Tube interface and the user port will be discussed in other application
  83. notes.  This note describesd the signal available on the 1Megahertz Bus, the
  84. circuitry required to utilise them, and the way in which they are connected
  85. to the Acorn Expansion Box.  The expansion memory map is also defined.  When
  86. interfacing designs to the 1MHz Bus, it is vital to ensure compatability
  87. with Acorn standards, to prevent problems when using several peices of
  88. equipment on the bus simultaneously.
  89.  
  90. Remember that the standards cover both hardware and software protocols.
  91.  
  92. It is as important for the software to follow these guidelines as it is for
  93. the hardware, otherwise simultaneous operations of several peripherals may
  94. not be possible.
  95.  
  96. The standards described allow up to 64K of pages address space to be
  97. accessed as well as 255 bytes of direct access ports.
  98.  
  99.  
  100.  
  101. 2  SIGNAL DEFINITIONS
  102.  
  103. The following lines are available on the 1MHz Expansion Connector:
  104.  
  105. A0 - A7 (pins 27-34)            The low eight address lines from the 6502,
  106. buffered by a 74LS244 (IC 71) permanently enabled.
  107.  
  108. D0 - D7 (pins 18-25)            A bi-directional data bus connected to the
  109. CPU through IC 72, a 74LS245 buffer.  The direction of data is determined by
  110. the system Read-not-write (R/W) line.  The buffer is only enabled if NPGFC
  111. or NPGFD is low (see below).
  112.  
  113. Analogue In (pin 16)            An input to the BBC Microcomputer audio
  114. circuitry.  Input impedance is 9K ohms.  A siganl of +/-3 volts RMS will
  115. produce a saturated siganl at the loudspeaker (full volume), though signals
  116. this large will cause distortion if the on-board sound or speech is used at
  117. the same time.
  118.  
  119. NRST (pin 14)                   Not Reset.  This is an OUTPUT ONLY for the
  120. system reset line (active low).  It may be used to initialise peripherals on power-up and when the "BREAK" key is pressed.
  121.  
  122. NPGFC & NPGFD (pins 10 & 12)    "Not page FC" and "Not page FD".  Page
  123. select signals decoded from the top eight address bits of the system data
  124. bus. These signals are active low.  Pages FC and FD (ie FC00 to FCFF and
  125. FD00 to FDFF hex) are the only pages available for general expansion.
  126. However, the paging register described in Section 5 allows a much larger
  127. address space to be accessed.
  128.  
  129. NIRQ (pin 8)                    Not Interrupt Request (active low). The
  130. system IRQ line which is open collector (ie "wired-or") and may be asserted
  131. by devices attached to the extension bus.  The pull-up resistor on this line
  132. is 3K3. IRQ is level triggered and it is absolutely essential for correct
  133. operation of the machine that interrupts do not occur until the software is
  134. capable of dealing with them.  Interrupts on the 1MHz bus should therefore
  135. be disabled on power-up and reset conditions. Significant use of interrupt
  136. service time may affect other machine functions. In particular, masking
  137. interrupts for more than 10mS will affect the real time clock.
  138.  
  139. NNMI (pin 6)                    Not Non-Maskable Interrupt (active low). 
  140. The system NMI  line which is open collector (ie wired-or) and may be
  141. asserted by devices attached to the extension bus.  The pull-up resistor on
  142. this line is also 3K3. It should be remembered that NMI is negative edge
  143. triggered and that both the disc and net chips on the main board use this
  144. line.  Caution must be exercised to avoid masking other interrupts by
  145. holding the line low. Use of NMI facilities on the BBC machine requires an
  146. advanced knowledge of 6502 programming techniques and the Operating System
  147. protocols.
  148.  
  149. IMHzE (pin 4)           A system clock timing signal which is a 1MHz 50%
  150. duty cycle square wave. During access to 1MHz peripherals and to the
  151. extension bus the processor clock (normally 2MHz) is stretched so that the
  152. trailing edges of 1MHzE and processor clock are coincident.
  153.  
  154. R/W (pin 2)             The system Read Not Write signal which is derived
  155. from the CPU R/W siganl through two 74LS04 inverters.
  156.  
  157. 0V (pins 1,3,5,7,9,11,13,15,17,26)      System 0V, ie GND wires, dispersed
  158. so as to interleave with asynchronous groups of signals in a flat ribbon
  159. cable.
  160.  
  161.  
  162.  
  163. 3  HARDWARE REQUIREMENTS FOR 1MHZ EXPANSION BUS PERIPHERALS
  164.  
  165.    1  No power may be drawn from the BBC Microcomputer.  Each peripheral
  166. should have its own integral power supply, although a separate power unit
  167. may be used.
  168.  
  169.    2  Not more than one low-power Schottky TTL load may be presented to any
  170. bus line by each peripheral.
  171.  
  172.    3  A 1MHz bus feed-through connector should be provided. Connection to
  173. the BBC Microcomputer should be via 600mm of 34-way ribbon cable terminated
  174. with a 34-way IDC socket, and fitted with strain relief.  Please note that
  175. copying the Teletext Adapter's layout is not possible, because this has been
  176. given the special status of the last box in the chain.
  177.  
  178.  
  179.    4  Optional bus termination should be provided on all bus lines except
  180. NRST, NNMI and NIRQ.  the recommended termination is a 2K2 resistor to +5V
  181. and a 2K2 resistor to ground for each line.
  182.  
  183.    5  The timing requirements for the 1MHz bus are detailed in Figure 1.
  184.  
  185.  
  186.  
  187. 4  FURTHER REQUIREMENTS FOR EQUIPMENT TO BE APPROVED BY ACORN COMPUTERS               
  188.  
  189.    1  Address space within page &FC must be allocated by the Research and
  190. Development Department of Acorn Computers Ltd - see Section 6.
  191.  
  192.    2  The dimensions of any peripheral and its associated integral power
  193. supplies should allow it to be fitted into the BBC Microcomputer Expansion
  194. Box - see Figure 4.
  195.  
  196.    3  When housed in the Expansion Box, the equipment should meet BS415
  197. Class 1 specifications for Electrical safety.
  198.  
  199. Further details of the requirements and procedures for gaining approval
  200. should be obtained from Acorn.  The information included here is for
  201. guidance only and is not intended to be a full specification for approval.
  202.  
  203.  
  204.  
  205. 5  DERIVATION OF VALID PAGE SIGNALS
  206.  
  207. 1MHz peripherals are clocked by a 1MHz 50% duty cycle square wave (chosen to
  208. allow chips such as the 6522 to use their timing elements reliably).  The
  209. BBC Microcomputer's cpu normally operates with a 2MHz clock, but with a
  210. slow-down circuit which has the effect of stretching the "clock high" period
  211. immediately following the detection of a valid 1MHz peripheral address.
  212.  
  213. There are two problems as a result of this. First, addresses will change and
  214. may momentarily become 1MHz addresses while the 2MHz cpu clock is low, but
  215. while the 1MHzE signal is high.  this could give rise to a spurious pulse on
  216. the chip select.  Second, if the cpu deliverately addresses a 1MHz
  217. peripheral during the time that 1MHzE is high, the device will be addressed
  218. immediately, and then again when 1MHzE is next high:  this is because the
  219. cpu clock will be held "high" by the stretching ciruit until the next
  220. coincident falling edge of the 1MHz and 2MHz clocks.  See Figure 2:  the two
  221. accesses are marked C and D.  this double access is not usually a problem
  222. except when reading from or writing to a location twice has some additional
  223. effect:  an example of this is an interrupt flag which is cleared by reading
  224. it.
  225.  
  226. These effects mean that the 1MHzE bux cannot be used as a conventional
  227. "address valid" signal.  However, addresses will always be valid on the
  228. rising edgte of 1MHzE.  If the chip select lines are latched by 1MHzE as
  229. shown in Figure 2, the clean signal CNGFC (or CNPGFD) will be generated.
  230.  
  231.  
  232.  
  233. 6  ADDRESS SPACE ALLOCATION
  234.  
  235. PAGE FC
  236.  
  237. Page FC is reserved for peripherals with small memory requirements. Only one
  238. peripheral will be allocated to each group of addresses.  Further
  239. allocations must be agreed with the R & D Department of Acorn Computers Ltd.
  240.  
  241. Initial allocations are:
  242.  
  243.         FC00 to FC0F            Test Hardware
  244.         FC10 to FC13            Teletext
  245.         FC14 to FC1F            Prestel
  246.         FC20 to FC27            IEEE 488 Interface
  247.         FC28 to FC2F            Acorn Expansion:  Spare
  248.         FC30 to FC3F            Cambridge Ring Interface
  249.         FC40 to FC47            Winchester Disc Interface
  250.         FC48 to FC7F            Acorn Expansion:  Spare
  251.         FC80 to FC8F            Test Hardware
  252.         FC90 to FCBF            Acorn Expansion:  Spare
  253.         FCC0 to FCFE            User Applications
  254.         FCFF                    Paging Register
  255.  
  256. PAGE FD
  257.  
  258. Page FD is used in conjunction with the paging register to provide a 64K
  259. address space, accessed one page at a time.  Each BBC Expansion Box will
  260. have a paging register on the backplane, thus data will be latched
  261. simultaneously on every Expansion Box.  Data latched into the paging
  262. register will provide the top eight address bits to the eurocard backplane. 
  263. These top address bits are referred to as the 'Extended Page Number'.  Any
  264. peripheral designed to locate in page RD without using an expansion
  265. backplane must latch and decode the paging address inforation.
  266.  
  267. To make this facility as easy to use as possible, NPGFD (a hazard free
  268. version of the signal available from PL 12) will be connected to the
  269. backplane pin 24b, 'Not Valid memory Address', and also OR-ed with the top
  270. four extended page address lines as a link selectable option to pin 31a
  271. 'BLKO'.  (The other option on this pin will be NPGFC).
  272.  
  273. Extended pages &00 to &7F are reserved for Acorn use, pages &80 to &FF may
  274. be freely used by special applicatons.  The paging register will be reset to
  275. &00 on power-up and BREAK.
  276.  
  277. Since the paging register is a write-only latch, location &00EE in the zero
  278. page of the BBC machine addressmap has been allocated as a RAM image of the
  279. register.   Note that this location will remain in the I/O processor's
  280. memory map if a second processor is fitted.
  281.  
  282. The importance of this image is that it allows interrupt routines to change
  283. the paging register and restore it again afterwards.
  284.  
  285. It is vital to change location &00Ee BEFORE changing the paging register
  286. itself.  It you do not, then an interrupt may occur before you change the
  287. RAM image and this will restore the paging register to the old value of &EE.
  288.  
  289. A suitable sequence is:
  290.  
  291.         LDA  #  new value
  292.         STA  &EE
  293.         STA  &FCFF              MACHINE CODE
  294.  
  295.                 OR. . . . .
  296.  
  297.         ?&EE  =  new value
  298.         ?&FCFF  = new value     BASIC
  299.  
  300. User routines should save the contents of &EE beforfe changing the paging
  301. register and restore both &Ee and &FCFF to this value before returning from
  302. the interrupt.
  303.  
  304. A suitable sequence is:
  305.  
  306.         [save processor registers etc.]
  307.  
  308.         LDA  &EE
  309.         STA  tempstore
  310.         LDA  #  new value
  311.         STA  &EE
  312.         STA  &FCFF
  313.  
  314.         [users code here]
  315.  
  316.         STA  &EE
  317.         STA  &FCFF
  318.  
  319.         [restore other data and return]
  320.  
  321.  
  322.  
  323. FIGURE 1  :  1MHz BUS TIMING DIAGRAM
  324.  
  325. Timing requirements
  326.  
  327. Parameter                       Symbol  Min     Max
  328.  
  329. Address Set-up Time             t as    300     1000
  330. (&R/W Set-up Time)
  331. Address Hold Time               t ah      30        -
  332. (&R/W Hold Time)
  333. NPGFC & NPGFD Set-up Time       t cs    250     1000
  334. NPGFC & NPGFD Hold Time t ch      30        -
  335. Write Data Set-up Time          t dsw      -      150
  336. Write Data Hold Time            t dhw     50        -
  337. Read Data Set-up Time           t dsr   200         -
  338. Read Data Hold Time             t dhr     30        -
  339.  
  340. Note: The above timings are based on only one peripheral attached to the
  341. Expansion Bus.  Heavy loading may slow the rise and fall times of 1MHzE with
  342. possible adverse effects on timings.
  343.  
  344.  
  345.  
  346. FIGURE 2  :  DERIVATION OF VALID PAGE SELECT SIGNAL
  347.  
  348. As the address lines settle, a momentary pulse could occur on the NPGFC (or
  349. NPGFD) line. The pulses at B are ignored because 1MHzE is low, but those at
  350. A could cause a spurious access.
  351.  
  352. When a valid 1MHz device address appears, NPGFC (or NPGFD) goes low: this
  353. can happen as shown whilst 1MHzE goes high, accessing the device.  when a
  354. 1MHz address is detected, the clock stretching circuit waits if necessary
  355. for the next rising edge of the 2MHz clock (point E), and holds the cpu
  356. clock (point F).  Hence the device is accessed again at point D, when 1MHzE
  357. is next high.  The gated signal CNPGFC (or CNPGFD) removes the glitches A
  358. and the first of the two accesses at C.
  359.  
  360.  
  361.  
  362. FIGURE 3  :  DERIVATION OF CLEAN SELECT SIGNALS
  363.  
  364. R-S flip-flop with gated input which allows 'clean select' to be set low
  365. only if 1MHzE is low. An alternative circuit using transparent flip-flops is
  366. shown on the circuit diagram for the Expansion box backplane (Drawing
  367. 107,000).
  368.